#include <iostream>
#include "ResourceParserDriver.h"

using namespace yy;

parser_driver::parser_driver ()
: trace_scanning (false), trace_parsing (false)
{
}

parser_driver::~parser_driver ()
{
}

void
parser_driver::parse (const std::string &f)
{
	class_table = ClassTable();
	class_table["material"] = SymbolTable();
	class_table["mesh"] = SymbolTable();
	file = f;
	scan_begin ();
	yy::parser parser (*this);
	parser.set_debug_level (trace_parsing);
	parser.parse ();
	scan_end ();
}

void
parser_driver::error (const yy::location& l, const std::string& m)
{
	std::cerr << l << ": " << m << std::endl;
}

void
parser_driver::error (const std::string& m)
{
	std::cerr << m << std::endl;
}

